{$asmmode att}
function Syscall0(n: ptruint): ptruint; assembler;
asm
   mov n, %eax
   int ServiceInterrupt
end;

function Syscall1(n: ptruint; p0: ptruint): ptruint; assembler;
asm
   pushl p0
   mov n, %eax
   int ServiceInterrupt
   addl $4, %esp
end;

function Syscall2(n: ptruint; p0,p1: ptruint): ptruint; assembler;
asm
   pushl p1
   pushl p0
   mov n, %eax
   int ServiceInterrupt
   addl $8, %esp
end;

function Syscall3(n: ptruint; p0,p1,p2: ptruint): ptruint; assembler;
asm
   pushl p2
   pushl p1
   pushl p0
   mov n, %eax
   int ServiceInterrupt
   addl $12, %esp
end;

function Syscall4(n: ptruint; p0,p1,p2,p3: ptruint): ptruint; assembler;
asm
   pushl p3
   pushl p2
   pushl p1
   pushl p0
   mov n, %eax
   int ServiceInterrupt
   addl $16, %esp
end;

function Syscall5(n: ptruint; p0,p1,p2,p3,p4: ptruint): ptruint; assembler;
asm
   pushl p4
   pushl p3
   pushl p2
   pushl p1
   pushl p0
   mov n, %eax
   int ServiceInterrupt
   addl $20, %esp
end;